<%@ page language="java" import="java.util.*,com.beans.*,com.dao.*"
	pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">

<title>My JSP 'index.jsp' starting page</title>
<link rel="stylesheet" type="text/css" href="css/edittable.css"></link>
<link rel="stylesheet" type="text/css" href="css/validate.css"></link>
<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
</head>

<body>
	<%
		String id = request.getParameter("id");
		AdminDao admindao = new AdminDao();
		AdminInfo admin = admindao.getAdminById(id);
		RoleDao roledao=new RoleDao();
		List<RoleInfo> roleList=roledao.getRoleList();
		request.setAttribute("roleList", roleList);
		request.setAttribute("admin", admin);
	
	%>
	<div class="div_title">
		<div class="div_titlename">
			<img src="images/san_jiao.gif"><span>管理员添加</span>
		</div>
	</div>

	<form action="RoleServlet.do?flag=modify&id=${admin.id }" method="post">
		<table class="edit_table">
			<tr>
				<td class="td_info">角色名称:</td>
				<td class="td_input_short"><input type="text" class="txtbox"
					id="adminName" name="adminName" value="${admin.adminName}" readonly="readonly" /></td>
				<td>
				</td>
			</tr>


			<tr>
				<td class="td_info">用户角色:</td>
				<td>
				<c:forEach var="role" items="${roleList }">
				
		 				 <c:choose>
								 		<c:when test="${admin.roleId==role.id }"><input type="radio" name="roleId"  value="${role.id }" checked  />${role.roleName }  <br /></c:when>
								 		<c:otherwise><input type="radio" name="roleId"  value="${role.id }"  />${role.roleName }  <br /></c:otherwise>
						</c:choose>
		 				  	</c:forEach>
		 		</td>
				
			</tr>
			<tr>
				<td class="td_info"></td>
				<td><input class="form_btn" type="submit" value="提交"  /> 
					<input type="reset" class="form_btn" value="返回" onclick="Javascript:history.go(-1);" /></td>
				<td><label id="result_msg" class="result_msg">${msg}</label></td>
			</tr>
		</table>
	</form>
</body>
</html>